package com.wing.financeSet.model.response;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.financeSet.model.entity.SubjectSet;

/**
 * 科目设置VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class SubjectSetVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 科目分类id
     */
    private Long subjectCategoryId;

    /**
     * 科目类型
     */
    private SubjectSet.SubjectType subjectType;

    /**
    * 科目类型描述
    */
    @TableField(exist = false)
    private String subjectTypeDesc;

    public String getSubjectTypeDesc() {
        return subjectType.getDesc();
    }

    private SubjectSet.BalanceDirection balanceDirection;

    @TableField(exist = false)
    private String balanceDirectionDesc;

    public String getBalanceDirectionDesc() {
        return balanceDirection == null ? null : balanceDirection.getDesc();
    }

    /**
     * 名称
     */
    private String name;

    /**
     * 助记码
     */
    private String mnemonicCode;
    /**
     * 币种
     */
    private SubjectSet.Currency currency;

    /**
    * 币种描述
    */
    @TableField(exist = false)
    private String currencyDesc;

    public String getCurrencyDesc() {
        return currency.getDesc();
    }

    /**
     * 默认单位
     */
    private String unitName;

    /**
     * 辅助账类型
     */
    private SubjectSet.SubsidiaryAccount subsidiaryAccount;

    /**
    * 辅助账类型描述
    */
    @TableField(exist = false)
    private String subsidiaryAccountDesc;

    public String getSubsidiaryAccountDesc() {
        return subsidiaryAccount.getDesc();
    }

    /**
     * 账页格式
     */
    private SubjectSet.LedgerFormat ledgerFormat;

    /**
    * 账页格式描述
    */
    @TableField(exist = false)
    private String ledgerFormatDesc;

    public String getLedgerFormatDesc() {
        return ledgerFormat.getDesc();
    }

    /**
     * 父ID
     */
    private Long parentId;

    /**
     * 排序
     */
    private Integer sortNumber;

    /**
     * 是否有子节点，0：无子节点，1：有子节点
     */
    private Boolean hasChild;

    /**
     * 是否子节点有启用，0：无，1；有
     */
    private Boolean hasEnableChild;

    /**
     * 是否终极分类
     */
    private Boolean isFinal;
    private Boolean isDeleted;

    private String subjectCategoryName;
    private String remark;

}
